<div style="padding-top: 15px; padding-bottom: 15px;">
	<div class="container">
		<a routerLink="/learn" class="btn btn-outline-dark" style="margin-top: 5px;">Back</a>
		<h2>Text</h2>
		<p>nunuStudio has support for 3D text, to create a 3D text object select it from the tool bar. The 3D text object is based on the mesh object, it has a material and a font attached. By default all 3D text objects create use the default font provided with nunuStudio.</p>

		<img src="assets/learn/basics/text/editor.jpg" style="width:60%; margin-left:20%"/>

		<h3>Load fonts</h3>
		<p>To load new fonts into nunuStudio select font on the import menu inside the asset explorer division or drag a compatible file into the asset explorer or directly into the 3D text object on the scene editor.</p>
		<p>nunuStudio has support for true type fonts and opentype JSON fonts.</p>
		<p>Some fonts migth have some problems due to their shape path being declared CCW, to solve this problem, right click on the font asset and select the option Reverse as shown bellow.</p>

		<img src="assets/learn/basics/text/bad.jpg" style="width:40%; margin-left:10%"/><img src="assets/learn/basics/text/good.jpg" style="width:40%"/>

		<h3>Change text and font</h3>
		<p>Its possible to edit the text of a 3D Text object on the object panel, but its also possible to do this programmatically using a script object and the following code</p>
		<pre><code class="hljs javascript">var text;

this.initialize = function()
{{'{'}}
text = scene.getObjectByName("text");
text.setText("123");
{{'}'}};</code></pre>
		<p>The code above will get the 3D Text object named "text" and changes it text to "123", its also possible to change the font using the code bellow.</p>
		<pre><code class="hljs javascript">var text, font;

this.initialize = function()
{{'{'}}
font = program.getFontByName("font");
text = scene.getObjectByName("text");
text.setFont(font);
{{'}'}};</code></pre>
	</div>
</div>
